comparison_data <- read.dta('input_data/extension_annual_series_comparison.dta')
comparison_data <- comparison_data[-25,]

# With political violence
pdf(paste("graphs/dummy_ext1.pdf",
          sep=""),
    width = 7, 
    height = 7)

par(mar=c(5, 12, 2, 1) + 0.1)
plot(comparison_data$year,
     comparison_data$rhs_violenceDUML0,
     type="l",
     ylim=c(0,.55),
     ylab="",
     xlab="")
lines(comparison_data$year,
      comparison_data$d_vio_complex ,
      type="l",
      lty=5)
lines(c(2005, 2005),
      c(-100, 5100) ,
      type="l",
      lty=1,
      col="gray")
legend("bottom", legend = c("CERAC", "Universidad del Rosario"),
       horiz = TRUE, inset = c(0,-.28),
       bty = "y",  xpd=TRUE, cex = .8, lty = c(1, 5))
dev.off()


# Without political violence
pdf(paste("graphs/dummy_ext2.pdf",
          sep=""),
    width = 7, 
    height = 7)

par(mar=c(5, 12, 2, 1) + 0.1)
plot(comparison_data$year,
     comparison_data$rhs_violenceDUML0,
     type="l",
     ylim=c(0,.5),
     ylab="",
     xlab="")
lines(comparison_data$year,
      comparison_data$d_vio_complexnovio ,
      type="l",
      lty=5)
lines(c(2005, 2005),
      c(-100, 5100) ,
      type="l",
      lty=1,
      col="gray")
legend("bottom", legend = c("CERAC", "Universidad del Rosario"),
       horiz = TRUE, inset = c(0,-.28),
       bty = "y",  xpd=TRUE, cex = .8, lty = c(1, 5))
dev.off()


# With political violence
pdf(paste("graphs/highdummy_ext1.pdf",
          sep=""),
    width = 7, 
    height = 7)

par(mar=c(5, 12, 2, 1) + 0.1)
plot(comparison_data$year,
     comparison_data$rhs_violenceHIGHDUML0,
     type="l",
     ylim=c(0,.25),
     ylab="",
     xlab="")
lines(comparison_data$year,
      comparison_data$d5_vio_complex ,
      type="l",
      lty=5)
lines(c(2005, 2005),
      c(-100, 5100) ,
      type="l",
      lty=1,
      col="gray")
legend("bottom", legend = c("CERAC", "Universidad del Rosario"),
       horiz = TRUE, inset = c(0,-.28),
       bty = "y",  xpd=TRUE, cex = .8, lty = c(1, 5))
dev.off()

# Without political violence
pdf(paste("graphs/highdummy_ext2.pdf",
          sep=""),
    width = 7, 
    height = 7)

par(mar=c(5, 12, 2, 1) + 0.1)
plot(comparison_data$year,
     comparison_data$rhs_violenceHIGHDUML0,
     type="l",
     ylim=c(0,.15),
     ylab="",
     xlab="")
lines(comparison_data$year,
      comparison_data$d5_vio_complexnovio ,
      type="l",
      lty=5)
lines(c(2005, 2005),
      c(-100, 5100) ,
      type="l",
      lty=1,
      col="gray")
legend("bottom", legend = c("CERAC", "Universidad del Rosario"),
       horiz = TRUE, inset = c(0,-.28),
       bty = "y",  xpd=TRUE, cex = .8, lty = c(1, 5))
dev.off()

# With political violence
pdf(paste("graphs/spike_ext1.pdf",
          sep=""),
    width = 7, 
    height = 7)

plot(comparison_data$year,
     comparison_data$CERACspike,
     type="l",
     ylim=c(0,.2),
     ylab="",
     xlab="")
lines(comparison_data$year,
      comparison_data$complexspike ,
      type="l",
      lty=5)
lines(c(2005, 2005),
      c(-100, 5100) ,
      type="l",
      lty=1,
      col="gray")
legend("bottom", legend = c("CERAC", "Universidad del Rosario"),
       horiz = TRUE, inset = c(0,-.28),
       bty = "y",  xpd=TRUE, cex = .8, lty = c(1, 5))
dev.off()


# With political violence
pdf(paste("graphs/spike_ext2.pdf",
          sep=""),
    width = 7, 
    height = 7)

plot(comparison_data$year,
     comparison_data$CERACspike,
     type="l",
     ylim=c(0,.15),
     ylab="",
     xlab="")
lines(comparison_data$year,
      comparison_data$complexnoviospike ,
      type="l",
      lty=5)
lines(c(2005, 2005),
      c(-100, 5100) ,
      type="l",
      lty=1,
      col="gray")
legend("bottom", legend = c("CERAC", "Universidad del Rosario"),
       horiz = TRUE, inset = c(0,-.28),
       bty = "y",  xpd=TRUE, cex = .8, lty = c(1, 5))
dev.off()


